package com.cjack.frenchexcel;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.net.ssl.SSLContext;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;

/**
 * Created by root on 4/4/19.
 */
@SpringBootApplication
//开启基于注解的定时任务
@EnableScheduling
public class Application {

    private static final Logger logger = LogManager.getLogger( Application.class);

    public static void main(String[] args) {
        try {
            SSLContext ctx = SSLContext.getInstance("TLSv1.1");
            ctx.init(null, null, null);
            SSLContext.setDefault(ctx); //将你所要使用的TLS版本设为默认
        } catch (NoSuchAlgorithmException e1) {
            e1.printStackTrace();
        } catch (KeyManagementException e) {
            e.printStackTrace();
        }
        System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");

        new SpringApplicationBuilder( Application.class).web(true).run(args);
        logger.info("Application started");
    }

}
